import java.util.*;
public class TimeTest {
    
    public static void main(String args[]) {
	/*
	Vector vv = new Vector();
	Vector v  = null;
	// get the supported ids for GMT-08:00 (Pacific Standard Time)
	String[] ids = TimeZone.getAvailableIDs(-8 * 60 * 60 * 1000);


	// if no ids were returned, something is wrong. get out.
	if (ids.length == 0) {
	    return;
	}
      
	for(int i=0; i<ids.length;i++) {
	    v = new Vector();
	    //v.add(ids[i]);
	    // begin output
	    // create a Pacific Standard Time time zone
	    // SimpleTimeZone(int rawOffset,String ID)
	    // Constructs a SimpleTimeZone with the given base time zone offset from GMT and 
	    // time zone ID with no daylight saving time schedule. 
	    SimpleTimeZone pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids[i]);

	    // set up rules for daylight savings time
	    pdt.setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
	    pdt.setEndRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);

	    // create a GregorianCalendar with the Pacific Daylight time zone
	    // and the current date and time
	    Calendar calendar = new GregorianCalendar(pdt);
	    Date trialTime = new Date();
	    calendar.setTime(trialTime);

	    //v.add("ERA: " + calendar.get(Calendar.ERA));
	    v.add("YEAR: " + calendar.get(Calendar.YEAR));
	    v.add("MONTH: " + calendar.get(Calendar.MONTH));
	    //v.add("WEEK_OF_YEAR: " + calendar.get(Calendar.WEEK_OF_YEAR));
	    //v.add("WEEK_OF_MONTH: " + calendar.get(Calendar.WEEK_OF_MONTH));
	    v.add("DATE: " + calendar.get(Calendar.DATE));
	    //v.add("DAY_OF_MONTH: " + calendar.get(Calendar.DAY_OF_MONTH));
	    //v.add("DAY_OF_YEAR: " + calendar.get(Calendar.DAY_OF_YEAR));
	    //v.add("DAY_OF_WEEK: " + calendar.get(Calendar.DAY_OF_WEEK));
	    //v.add("DAY_OF_WEEK_IN_MONTH: "
	    //+ calendar.get(Calendar.DAY_OF_WEEK_IN_MONTH));
	    v.add("AM_PM: " + calendar.get(Calendar.AM_PM));
	    v.add("HOUR: " + calendar.get(Calendar.HOUR));
	    //v.add("HOUR_OF_DAY: " + calendar.get(Calendar.HOUR_OF_DAY));
	    v.add("MINUTE: " + calendar.get(Calendar.MINUTE));
	    v.add("SECOND: " + calendar.get(Calendar.SECOND));
	    //v.add("MILLISECOND: " + calendar.get(Calendar.MILLISECOND));
	    v.add("ZONE_OFFSET: "+ (calendar.get(Calendar.ZONE_OFFSET)/(60*60*1000)));
	    v.add("DST_OFFSET: "+ (calendar.get(Calendar.DST_OFFSET)/(60*60*1000)));
	
	    calendar.clear(Calendar.HOUR_OF_DAY); // so doesn't override
	    calendar.set(Calendar.HOUR, 3);
	    //v.add("ERA: " + calendar.get(Calendar.ERA));
	    v.add("\nYEAR: " + calendar.get(Calendar.YEAR));
	    v.add("MONTH: " + calendar.get(Calendar.MONTH));
	    //v.add("WEEK_OF_YEAR: " + calendar.get(Calendar.WEEK_OF_YEAR));
	    //v.add("WEEK_OF_MONTH: " + calendar.get(Calendar.WEEK_OF_MONTH));
	    v.add("DATE: " + calendar.get(Calendar.DATE));
	    //v.add("DAY_OF_MONTH: " + calendar.get(Calendar.DAY_OF_MONTH));
	    //v.add("DAY_OF_YEAR: " + calendar.get(Calendar.DAY_OF_YEAR));
	    //v.add("DAY_OF_WEEK: " + calendar.get(Calendar.DAY_OF_WEEK));
	    //v.add("DAY_OF_WEEK_IN_MONTH: "
	    //+ calendar.get(Calendar.DAY_OF_WEEK_IN_MONTH));
	    v.add("AM_PM: " + calendar.get(Calendar.AM_PM));
	    v.add("HOUR: " + calendar.get(Calendar.HOUR));
	    //v.add("HOUR_OF_DAY: " + calendar.get(Calendar.HOUR_OF_DAY));
	    v.add("MINUTE: " + calendar.get(Calendar.MINUTE));
	    v.add("SECOND: " + calendar.get(Calendar.SECOND));
	    //v.add("MILLISECOND: " + calendar.get(Calendar.MILLISECOND));
	    v.add("ZONE_OFFSET: "+ (calendar.get(Calendar.ZONE_OFFSET)/(60*60*1000))); // in hours
	    v.add("DST_OFFSET: " + (calendar.get(Calendar.DST_OFFSET)/(60*60*1000))); // in hours
	    vv.add(v);
	}

	System.out.println("YEAR\t MONTH\t DATE\t AM_PM\t HOUR\t MINUTE\t SECOND\t ZONE_OFFSET\t DST_OFFSET");
	Enumeration enum = vv.elements();
	Enumeration enum2 = null;

	while(enum.hasMoreElements()) {
	    v = (Vector)enum.nextElement();
	    enum2 = v.elements();
	    while(enum2.hasMoreElements()) {
		System.out.print(enum2.nextElement()+"\t");		
	    }
	    System.out.println();
	}
	*/
	printAvaiableIds(-5*60*60*1000);
    }

    private static void printAvaiableIds() {
	String[] ids = TimeZone.getAvailableIDs();
	for(int i=0; i<ids.length;i++) {
	    System.out.println(ids[i]);
	}
    }
    private static void printAvaiableIds(int rawoffset) {
	String[] ids = TimeZone.getAvailableIDs(rawoffset);
	for(int i=0; i<ids.length;i++) {
	    System.out.println(ids[i]);
	}
    }
}
